﻿# These buildings are only for showing background graphics, e.g. the walls around holdings

# No Walls
walls_00 = {
	is_graphical_background = yes

	asset = {
		type = pdxmesh
		name = "western_walls_00_mesh"
	}

	is_enabled = {
		OR = {
			AND = {
				is_county_capital = no
				fort_level < 1
			}
			# Using the no_wall holding graphics for cities with special walls so that they don't have double walls
			has_building_or_higher = "city_wall_of_toledo_01"			
			has_building_or_higher = "roman_wall_of_lugo_01"
			has_building_or_higher = "kano_walls_01"
			has_building_or_higher = "jaisalmer_fort_01"
			# Herders shouldn't have walls
			scope:holder = {
				government_has_flag = government_is_herder
			}
			# Shogunate: Japanese small holdings shouldn't have walls
			AND = {
				NOT = { building_requirement_castle_city_church = { LEVEL = 03 } }
				scope:holder = {
					NOR = {
						government_has_flag = government_is_tribal
						government_has_flag = government_is_nomadic
						government_has_flag = government_is_herder
					}
				}
			}
		}
	}
}

# Any city that must be sieged gets the basic walls
walls_01_tribal = {
	is_graphical_background = yes

	asset = {
		type = pdxmesh
		names = {
			"tribal_walls_01_a_mesh"
		}
	}

	is_enabled = {
		OR = {
			is_county_capital = yes
			fort_level > 0
		}
		NOR = {
			# disabling this level of walled graphics for holdings with special walls and other fortifications so that they always look appropriately fortified. Note: If any of these buildings are given unique 3D assets, this should be looked at again.
			has_building_or_higher = "palisades_01"
			has_building_or_higher = "curtain_walls_01"
			has_building_or_higher = "hill_forts_01"
			has_building_or_higher = "ramparts_01"
			has_building_or_higher = "watchtowers_01"
			has_building_or_higher = "theodosian_walls_01"
			has_building_or_higher = "walls_of_benin_01"
			has_building_or_higher = "walls_of_genoa_01"
			has_building_or_higher = "aurelian_walls_01"
			has_building_or_higher = "city_wall_of_toledo_01"
			has_building_or_higher = "roman_wall_of_lugo_01"
		}
		# Nomads use custom walls
		scope:holder = { NOT = { government_has_flag = government_is_nomadic } }
		# Shogunate: Japanese small holdings shouldn't have walls
		scope:holder = {
			OR = {
				government_has_flag = government_is_tribal
				government_has_flag = government_is_nomadic
				government_has_flag = government_is_herder
			}
		}
	}
}

# Here the Fort Level building chains take control of the visuals
walls_01 = {
	is_graphical_background = yes
	asset = {
		type = pdxmesh
		names = {
			"western_walls_01_a_mesh"
			"western_walls_01_b_mesh"
		}
		graphical_regions = { graphical_western graphical_mediterranean graphical_india }
	}
	asset = {
		type = pdxmesh
		names = {
			"mena_walls_01_a_mesh"
			"mena_walls_01_b_mesh"

		}
		graphical_regions = { graphical_mena graphical_steppe }
	}
	asset = {
		type = pdxmesh
		requires_dlc_flag = the_northern_lords
		graphical_cultures = { norse_building_gfx }
		names = {
			"fp1_norse_walls_01_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_northern_lords
		graphical_cultures = { norse_building_gfx }
		graphical_regions = { graphical_mena }
		names = {
			"fp1_norse_walls_01_mena_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_fate_of_iberia
		graphical_cultures = { iberian_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"fp2_building_iberian_wall_01_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = legacy_of_persia
		graphical_cultures = { iranian_building_gfx }
		graphical_regions = { graphical_mena graphical_india graphical_steppe }
		names = {
			"fp3_building_persian_walls_01_a_01_mesh"
		}
	}
	asset = {
		type = pdxmesh
		requires_dlc_flag = khans_of_the_steppe
		graphical_cultures = { steppe_building_gfx }
		graphical_regions = { graphical_steppe }
		governments = { nomad_government }
		names = {
			"mpo_mongol_wall_01_mesh"
		}

	}

	is_enabled = {
		OR = {
			# These buildings will trigger the visual "upgrade" to this wall asset
			has_building_or_higher = "palisades_01"
			has_building_or_higher = "curtain_walls_01"
			has_building_or_higher = "hill_forts_01"
			has_building_or_higher = "ramparts_01"
			has_building_or_higher = "watchtowers_01"
			scope:holder = {
				government_has_flag = government_is_nomadic
				root = { fort_level = 1 }
			}
		}
		NOR = {
			# Disabling this level of walled graphics for holdings with special walls and other fortifications so that they always look appropriately fortified. Note: If any of these buildings are given unique 3D assets, this should be looked at again.
			has_building_or_higher = "palisades_02"
			has_building_or_higher = "curtain_walls_02"
			has_building_or_higher = "hill_forts_02"
			has_building_or_higher = "ramparts_02"
			has_building_or_higher = "watchtowers_02"
			has_building_or_higher = "theodosian_walls_01"
			has_building_or_higher = "walls_of_benin_01"
			has_building_or_higher = "walls_of_genoa_01"
			has_building_or_higher = "aurelian_walls_01"
			has_building_or_higher = "city_wall_of_toledo_01"
			has_building_or_higher = "roman_wall_of_lugo_01"
		}
		# Shogunate
		scope:holder = {
			OR = {
				government_has_flag = government_is_tribal
				government_has_flag = government_is_nomadic
				government_has_flag = government_is_herder
			}
		}
	}
}

walls_02 = {
	is_graphical_background = yes

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_western graphical_mediterranean graphical_india }
		names = {
			"western_walls_02_a_mesh"
			"western_walls_02_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_mena graphical_steppe }
		names = {
			"mena_walls_02_a_mesh"
			"mena_walls_02_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_northern_lords
		graphical_cultures = { norse_building_gfx }
		names = {
			"fp1_norse_walls_02_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_northern_lords
		graphical_cultures = { norse_building_gfx }
		graphical_regions = { graphical_mena }
		names = {
			"fp1_norse_walls_02_mena_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_fate_of_iberia
		graphical_cultures = { iberian_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"fp2_building_iberian_wall_02_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = legacy_of_persia
		graphical_cultures = { iranian_building_gfx }
		graphical_regions = { graphical_mena graphical_india graphical_steppe }
		names = {
			"fp3_building_persian_walls_02_a_01_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = roads_to_power
		graphical_cultures = { byzantine_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"ep3_byzantine_walls_02_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = khans_of_the_steppe
		graphical_cultures = { steppe_building_gfx }
		graphical_regions = { graphical_steppe }
		governments = { nomad_government }
		names = {
			"mpo_mongol_wall_02_mesh"
		}
	}

	is_enabled = {
		OR = {
			# These buildings will trigger the visual "upgrade" to this wall asset
			has_building_or_higher = "palisades_02"
			has_building_or_higher = "curtain_walls_02"
			has_building_or_higher = "hill_forts_02"
			has_building_or_higher = "ramparts_02"
			has_building_or_higher = "watchtowers_02"
			scope:holder = {
				government_has_flag = government_is_nomadic
				root = { fort_level = 2 }
			}
		}
		NOR = {
			# Disabling this level of walled graphics for holdings with special walls and other fortifications so that they always look appropriately fortified. Note: If any of these buildings are given unique 3D assets, this should be looked at again.
			has_building_or_higher = "curtain_walls_03"
			has_building_or_higher = "hill_forts_03"
			has_building_or_higher = "ramparts_03"
			has_building_or_higher = "watchtowers_03"
			has_building_or_higher = "theodosian_walls_01"
			has_building_or_higher = "walls_of_benin_01"
			has_building_or_higher = "walls_of_genoa_01"
			has_building_or_higher = "aurelian_walls_01"
			has_building_or_higher = "city_wall_of_toledo_01"
			has_building_or_higher = "roman_wall_of_lugo_01"
		}
		# Shogunate
		scope:holder = {
			OR = {
				government_has_flag = government_is_tribal
				government_has_flag = government_is_nomadic
				government_has_flag = government_is_herder
			}
		}
	}
}

walls_03 = {
	is_graphical_background = yes

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_western }
		names = {
			"western_walls_03_a_mesh"
			"western_walls_03_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_mediterranean }
		names = {
			"mediterranean_walls_03_a_mesh"
			"mediterranean_walls_03_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_mena graphical_steppe }
		names = {
			"mena_walls_03_a_mesh"
			"mena_walls_03_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_india }
		names = {
			"india_walls_03_a_mesh"
			"india_walls_03_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_fate_of_iberia
		graphical_cultures = { iberian_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"fp2_building_iberian_wall_03_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = legacy_of_persia
		graphical_cultures = { iranian_building_gfx }
		graphical_regions = { graphical_mena graphical_india graphical_steppe }
		names = {
			"fp3_building_persian_walls_03_a_01_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = roads_to_power
		graphical_cultures = { byzantine_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"ep3_byzantine_walls_03_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = khans_of_the_steppe
		graphical_cultures = { steppe_building_gfx }
		graphical_regions = { graphical_steppe }
		governments = { nomad_government }
		names = {
			"mpo_mongol_wall_03_mesh"
		}
	}

	### Shogunate ###
	asset = {
		type = pdxmesh
		graphical_cultures = { yamato_building_gfx }
		names = {
			"japanese_walls_03_mesh"
		}
	}

	is_enabled = {
		scope:holder = {
			NOT = { government_has_flag = government_is_tribal }
		}
		OR = {
			# These buildings will trigger the visual "upgrade" to this wall asset
			has_building_or_higher = "curtain_walls_03"
			has_building_or_higher = "hill_forts_03"
			has_building_or_higher = "ramparts_03"
			has_building_or_higher = "watchtowers_03"
			has_building_or_higher = "walls_of_benin_01"
			has_building_or_higher = "walls_of_genoa_01"
			has_building_or_higher = "aurelian_walls_01"
			scope:holder = {
				government_has_flag = government_is_nomadic
				root = { fort_level = 3 }
			}
			# Shogunate
			scope:holder = {
				NOR = {
					government_has_flag = government_is_tribal
					government_has_flag = government_is_nomadic
					government_has_flag = government_is_herder
				}
				root = {
					building_requirement_castle_city_church = { LEVEL = 03 }
					NOT = { building_requirement_castle_city_church = { LEVEL = 04 } }
				}
			}
		}
		NOR = {
			# Disabling this level of walled graphics for holdings with special walls and other fortifications so that they always look appropriately fortified. Note: If any of these buildings are given unique 3D assets, this should be looked at again.
			has_building_or_higher = "curtain_walls_06"
			has_building_or_higher = "hill_forts_06"
			has_building_or_higher = "ramparts_06"
			has_building_or_higher = "watchtowers_06"
			has_building_or_higher = "theodosian_walls_01"
			has_building_or_higher = "city_wall_of_toledo_01"
			has_building_or_higher = "roman_wall_of_lugo_01"
		}
	}
}

walls_04 = {
	is_graphical_background = yes

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_western }
		names = {
			"western_walls_04_a_mesh"
			"western_walls_04_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_mediterranean }
		names = {
			"mediterranean_walls_04_a_mesh"
			"mediterranean_walls_04_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_mena graphical_steppe }
		names = {
			"mena_walls_04_a_mesh"
			"mena_walls_04_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		graphical_regions = { graphical_india }
		names = {
			"india_walls_04_a_mesh"
			"india_walls_04_a_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = the_fate_of_iberia
		graphical_cultures = { iberian_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"fp2_building_iberian_wall_04_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = legacy_of_persia
		graphical_cultures = { iranian_building_gfx }
		graphical_regions = { graphical_mena graphical_india  graphical_steppe }
		names = {
			"fp3_building_persian_walls_04_a_01_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = roads_to_power
		graphical_cultures = { byzantine_building_gfx }
		graphical_regions = { graphical_mediterranean }
		names = {
			"ep3_byzantine_walls_04_mesh"
		}
	}

	asset = {
		type = pdxmesh
		requires_dlc_flag = khans_of_the_steppe
		graphical_cultures = { steppe_building_gfx }
		graphical_regions = { graphical_steppe }
		governments = { nomad_government }
		names = {
			"mpo_mongol_wall_04_mesh"
		}
	}

	### Shogunate ###
	asset = {
		type = pdxmesh
		graphical_cultures = { yamato_building_gfx }
		names = {
			"japanese_walls_04_mesh"
		}
	}

	is_enabled = {
		scope:holder = {
			NOT = { government_has_flag = government_is_tribal }
		}
		OR = {
			# These buildings will trigger the visual "upgrade" to this wall asset
			has_building_or_higher = "curtain_walls_06"
			has_building_or_higher = "hill_forts_06"
			has_building_or_higher = "ramparts_06"
			has_building_or_higher = "watchtowers_06"
			has_building_or_higher = "theodosian_walls_01"
			scope:holder = {
				government_has_flag = government_is_nomadic
				root = { fort_level >= 4 }
			}
			# Shogunate
			scope:holder = {
				NOR = {
					government_has_flag = government_is_tribal
					government_has_flag = government_is_nomadic
					government_has_flag = government_is_herder
				}
				root = {
					building_requirement_castle_city_church = { LEVEL = 04 }
				}
			}
		}
	}
}
